﻿using System;
using AChance.Dal.Func;
using AChance.Func;

namespace AChance.Bll.Func
{
    /// <summary>
    /// 交易信息
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = false)]
    internal class BllTransAttribute : Attribute
    {
        /// <summary>
        /// 加锁模式
        /// </summary>
        public FunLock.Mode LockMode { get; set; } = FunLock.Mode.No;
        /// <summary>
        /// 加锁期限
        /// </summary>
        public double LockExpiry { get; set; } = FunLock.Span.EXPIRY;
        /// <summary>
        /// 加锁等待
        /// </summary>
        public double LockWait { get; set; } = FunLock.Span.WAIT;
        /// <summary>
        /// 加锁重试
        /// </summary>
        public double LockRetry { get; set; } = FunLock.Span.RETRY;
        /// <summary>
        /// 数据库操作模式
        /// </summary>
        public DalConst.SqlOperMode SqlOperMode { get; set; } = DalConst.SqlOperMode.ReadWrite;
    }

    /// <summary>
    /// 数据信息
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = false)]
    internal class BllDataAttribute : Attribute
    {
        /// <summary>
        /// 显示名称
        /// </summary>
        public string DispName { get; set; }
        /// <summary>
        /// 必需
        /// </summary>
        public bool Need { get; set; } = false;
    }
}
